package cn.chencaiju.lucene;

import java.io.FileInputStream;
import java.io.IOException;

import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
import org.apache.poi.xwpf.usermodel.XWPFDocument;

public class WordExtractor {
	public static void main(String[] args) {
		try (
			FileInputStream is = new FileInputStream("E:\\camp\\camp2018\\lucene-elastic-search-day01\\lucene-elasticsearch-day01.docx");
			XWPFWordExtractor extractor = new XWPFWordExtractor(new XWPFDocument(is));
				) {
			
			String text = extractor.getText();
			System.out.println(text);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}